
*R7 AB analysis


clear

set more off

import spss using "~/Dropbox/LGBTQ project/Aforbarometer R7/zim_r7_data.sav"

gen not_dislike_homo_neigh = 1 if Q87C == 3
replace not_dislike_homo_neigh = 1 if Q87C == 4
replace not_dislike_homo_neigh = 1 if Q87C == 5
replace not_dislike_homo_neigh = 1 if Q87C == 9
replace not_dislike_homo_neigh = 0 if Q87C == 1
replace not_dislike_homo_neigh = 0 if Q87C == 2

gen not_dislike_homo_neigh2 = 1 if Q87C == 3
replace not_dislike_homo_neigh2 = 1 if Q87C == 4
replace not_dislike_homo_neigh2 = 1 if Q87C == 5
replace not_dislike_homo_neigh2 = 0 if Q87C == 1
replace not_dislike_homo_neigh2 = 1 if Q87C == 2
replace not_dislike_homo_neigh2 = 1 if Q87C == 9

rename Q1 age

gen female = 1 if Q101 == 2
replace female = 0 if Q101 == 1

*edu: complete primary, some or finish HS, more than HS ... jsut do dummies for all categories in the original question

rename Q97 edu

gen comp_prim = 1 if edu == 3
replace comp_prim = 0 if edu < 3 | edu > 3

gen some_finish_hs = 1 if edu == 4
replace some_finish_hs = 1 if edu == 5
replace some_finish_hs = 0 if edu < 4 | edu > 5

gen more_than_hs = 1 if edu > 5
replace more_than_hs = 0 if edu <= 5


*asset index for income
*code as 1 if you or someone else in hosuehold owns it

gen own_radio = 0 if Q89A == 0
replace own_radio = 1 if Q89A == 1
replace own_radio = 1 if Q89A == 2

gen own_tv = 0 if Q89B == 0
replace own_tv = 1 if Q89B == 1
replace own_tv = 1 if Q89B == 2

gen own_car = 0 if Q89C == 0
replace own_car = 1 if Q89C == 1
replace own_car = 1 if Q89C == 2

gen own_computer = 0 if Q89D == 0
replace own_computer = 1 if Q89D == 1
replace own_computer = 1 if Q89D == 2

gen own_bank = 0 if Q89E == 0
replace own_bank = 1 if Q89E == 1
replace own_bank = 1 if Q89E == 2

gen own_phone = 0 if Q89F == 0
replace own_phone = 1 if Q89F == 1
replace own_phone = 1 if Q89F == 2

gen asset_index = (own_radio + own_tv + own_car + own_computer + own_bank + own_phone)/6


*partisanship

gen opp_part = 1 if Q88B < 861
replace opp_part = 1 if Q88B > 861 & Q88B < 9997
replace opp_part = 0 if Q88B == 861 | Q88B == 9997

gen zanu_part = 1 if Q88B == 861
replace zanu_part = 0 if Q88B != 861 & Q88B <= 9997


*recode based on vote choice

gen zanu_part2 = zanu_part
replace zanu_part2 = 1 if Q99 == 861 & zanu_part2 == 0

gen opp_part2 = opp_part
replace opp_part2 = 1 if Q99 == 860 & opp_part2 == 0
replace opp_part2 = 1 if Q99 > 861 & Q99 < 9997 & opp_part2 == 0


*count of groups the person is a part of, regardless of role; but it only asks about 2

gen relig_grp = 0 if Q20A == 0
replace relig_grp = 1 if Q20A == 1
replace relig_grp = 1 if Q20A == 2
replace relig_grp = 1 if Q20A == 3

gen volun_grp = 0 if Q20B == 0
replace volun_grp = 1 if Q20B == 1
replace volun_grp = 1 if Q20B == 2
replace volun_grp = 1 if Q20B == 3


gen num_grp_member = relig_grp + volun_grp



*the above captures what we have in our original appendix models

*now control or and then divide sample by urban/rural


gen urban = 1 if URBRUR == 1
replace urban = 0 if URBRUR == 2


*religiousity and internet

*only 15 evangelicals, so only do dummy for pentecostal

gen pentecostal = 1 if Q98 == 13
replace pentecostal = 0 if (Q98 < 13 | Q98 > 13) & Q98 < 9999

*no religiousity question but have trust in religious leaders
*code a 1, if they say somewhat or a lot

gen trust_relig = 1 if Q43K == 2
replace trust_relig = 1 if Q43K == 3
replace trust_relig = 0 if Q43K == 0
replace trust_relig = 0 if Q43K == 1
replace trust_relig = 0 if Q43K == 9



*internet access/use; jsut keep the categorial variable, increasing in use
rename Q91B internet_use

replace internet_use = . if internet_use == 9

*code = 1 if a few times a month or more_than_hs

gen internet_use_regular = 1 if internet_use == 2
replace internet_use_regular = 1 if internet_use == 3
replace internet_use_regular = 1 if internet_use == 4
replace internet_use_regular = 0 if internet_use == 0
replace internet_use_regular = 0 if internet_use == 1




*Table 1

sum age female comp_prim some_finish_hs more_than_hs opp_part2 zanu_part2 pentecostal if urban == 1

*Table A8

reg not_dislike_homo_neigh age female comp_prim some_finish_hs more_than_hs asset_index opp_part2 zanu_part2 num_grp_member pentecostal trust_relig internet_use_regular i.REGION if urban == 1




